Skip to content

Update OpenAPI generator to add param and field documentation#896

Merged
ashwinb merged 5 commits intomainfrom
spec_update
Jan 29, 2025
Merged

Update OpenAPI generator to add param and field documentation#896
ashwinb merged 5 commits intomainfrom
spec_update

Conversation

@ashwinb
Copy link
Copy Markdown
Contributor

@ashwinb ashwinb commented Jan 29, 2025

We desperately need to document our APIs. This is the basic requirement of having a Spec :)

This PR updates the OpenAPI generator so documentation for request parameters and object fields can be properly added to the OpenAPI specs. From there, this should get picked by Stainless, etc.

Test Plan:

Updated client-sdk (See llamastack/llama-stack-client-python#104) and then ran:

cd tests/client-sdk
LLAMA_STACK_CONFIG=../../llama_stack/templates/fireworks/run.yaml pytest -s -v inference/test_inference.py agents/test_agents.py

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jan 29, 2025
)


@json_schema_type
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found a bunch of older cruft re: batch completion and misplaced types, etc. I fixed those in this update as well.

# add property docstring if available
property_doc = property_docstrings.get(property_name)
if property_doc:
# print(output_name, property_doc)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I kept it on purpose as a reminder about where I had added this print. It took me a long time yesterday to figure out this doc stuff :)

- name: Types
tags:
- AgentCandidate
- AgentConfig
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is these x-tagGroups deleted on purpose?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yanxi0830 yes, on purpose. It was just noise. There is no point to generating separate Tags for component schemas.

@ashwinb ashwinb merged commit 0d96070 into main Jan 29, 2025
2 checks passed
@ashwinb ashwinb deleted the spec_update branch January 29, 2025 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants